/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package se.kth.lwr.jeat.core;

import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

/** ResourcCategories defines different kind of basic resources used during
 * activities in a ESA model, e.g. Gravel, Water, Uranium etc. ResourceCategories 
 * also holds a reference to all existing ResourceCategories, which can be 
 * acquired by the method <code>getCategories()</code>. There is a standard set 
 * of ResourceCategories that are statically available from this class. However 
 * it is easy to expand the set of standard Categories. See {@link EmissionCategory}
 * for further details.
 * 
 * @see EmissionCategory 
 * 
 *
 * @author david
 */
public abstract class ResourceCategory extends Category<ResourceCategory> {
    
    private static Set<ResourceCategory> categories=new HashSet<>();
    
    /**
     * Creates a new ResourceCategory
     * @param name name of category
     * @param description description of category
     */
    public ResourceCategory(String name, String description) {
        super(name,description);
        categories.add(this);
    }

    
    /**
     * 
     * 
     * @return a Collection of all defined ResourceCategories
     */

    public Set<ResourceCategory> getCategories() {
        //Return a copy of defined categories
        return Collections.unmodifiableSet(categories);
    }

    //Here goes implementation of standard Resources

    /**
     * Iron ore
     */
    public static final ResourceCategory IRON=new ResourceCategory("Iron ore", "Iron ore"){};
    
    /**
     * Apatite, mineral phosphous (P) 
     */
    public static final ResourceCategory APATITE= new ResourceCategory("APATITE", "Apatite, mineral phosphous (P) used for fertilizer production"){};
    
    /**
     * Water, raw water (H2O)
     */
    public static final ResourceCategory WATER= new ResourceCategory("WATER", "Water, raw water (H2O)"){};
    
    /**
     * Lime, raw lime (CaCO3)
     */
    public static final ResourceCategory LIME= new ResourceCategory("LIME", "Lime, raw lime (CaCO3)"){};
    
     /**
     * Macadam
     */
    public static final ResourceCategory MACADAM= new ResourceCategory("MACADAM", "Macadam single grained stone"){};
    
    
    /**
     * Natural gravel or sand material
     */
    public static final ResourceCategory GRAVEL=new ResourceCategory("GRAVEL", "Natural gravel or sand material") {};



}
